package com.py.credit.clean.code;

import java.lang.reflect.Method;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;

public class TableFrSfzCf {
	public final static String IdcardValidator = "com.py.credit.clean.code.IdcardValidator";
	public boolean run(Map<String, Object> map, String extend) {

		if (map.get("CF_FDDBRZJLX").equals("身份证")) {
			try {
                Class<?> c = Class.forName(IdcardValidator);
                Method m = c.getMethod("run", String.class, String.class);
                String data = (String) map.get("CF_FDDBRZJHM");
                return (boolean) m.invoke(c.newInstance(), data, "");
            } catch (Exception e) {
                return false;
            }
		}
		else if(StringUtils.isNotBlank((String) map.get("CF_FDDBRZJLX"))) {
			if (StringUtils.isNotBlank((String) map.get("CF_FDDBRZJHM"))) {
				return true;
			} else {
				return false;
			}
		}
		else {
			return true;
		}
		}
}
